﻿using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace Solidi
{
	public sealed class DependencyContext : IDependencyContext
	{
		private object _id;
		private IDependencyRegistry _registry;
		private IDependencyResolver _resolver;
		private IDependencyLifetime _lifetime;
	
		public DependencyContext(IDependencyContainer container)
		{
			_id = new object();
			_registry = container.Registry;
			_resolver = container.Resolver;
			_lifetime = container.Lifetime;
		}

		public IDependencyRegistry Registry
		{
			get
			{
				return _registry;
			}
		}

		public IDependencyLifetime Lifetime
		{
			get
			{
				return _lifetime;
			}
		}

		public IDependencyResolver Resolver
		{
			get
			{
				return _resolver;
			}
		}

		public object Id
		{
			get
			{
				return _id;
			}
		}

		public object Resolve(IDependencyKey key)
		{
			return _resolver.Resolve(this, key);
		}

		public void Dispose()
		{
			throw new NotImplementedException();
		}
	}
}
